package fr.mma.achievement.controller;

import fr.mma.achievement.model.persistence.Achievement;
import fr.mma.livraison.model.dto.LivraisonApplicationDTO;

public class CountAchievementController extends AchievementController {
	
	private int max;
	
	public CountAchievementController(int pMax){
		max = pMax;
	}
	
	@Override
	void update(Achievement achievement, LivraisonApplicationDTO livraisonApplication) {
		achievement.setCount(achievement.getCount()+1);
		achievement.setFinish(max<=achievement.getCount());
	}

}
